package com.l024.common.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class LogUtils {
    private static Logger logger=null;

    public static void logInfo(String message) {
        StackTraceElement[] stacks =(new Throwable()).getStackTrace();
        String newClass = stacks[1].getClassName();
        if(logger ==null || !newClass.equals(logger.getName()) ) {
            logger =LoggerFactory.getLogger(newClass );
        }
        StringBuffer logInfo= new  StringBuffer(100);
        logInfo.append("[");
        logInfo.append(stacks[1].getLineNumber());
        logInfo.append("]");
        logInfo.append(stacks[1].getMethodName());
        logInfo.append("info：");
        logInfo.append(message);
        logger.info(logInfo.toString());

    }

}